Time zone info just needs to be calculated in S3 suspend procedure.
However, time_suspend() is also called on AP. That wasteful
get_cmos_time() on AP may break __cpu_die() assumption since
get_cmos_time() can take up to one second. This fix just limits it to
running on the BSP.
Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
int time_suspend(void)
{
- cmos_utc_offset = (wc_sec + (wc_nsec + NOW()) / 1000000000ULL)
- - get_cmos_time();
+ if ( smp_processor_id() == 0 )
+ {
+ cmos_utc_offset = -get_cmos_time();
+ cmos_utc_offset += (wc_sec + (wc_nsec + NOW()) / 1000000000ULL);
+ }
/* Better to cancel calibration timer for accuracy. */
kill_timer(&this_cpu(cpu_time).calibration_timer);